extends "../botelan-2/botelan-2.gd"

func _extInit():
	._extInit()
	lv = 3             #等级的设置
	addSkill("30%概率格挡伤害，本回合内每次成功格挡获得4%[吸血、暴击、爆伤]，上限150%", "防御号令")
var gdCount = 0
func _onHurt(atkInfo):
	._onHurt(atkInfo)
	if sys.rndPer(p3):
		atkInfo.hurtVal = 0
		gdCount += 1
		if lv == 4 and gdCount >= 6:
			fyzj()
			gdCount = 0
		var buff = hasBuff("b_btl_fyhl")
		if buff == null:
			addBuff(b_btl_fyhl.new())
		elif (buff.att.suck < 1.5 and team == 1) or (buff.att.suck < 1 and team == 2):
			buff.att.suck += 0.04
			buff.att.cri += 0.04
			buff.att.criR += 0.04
			if upgraded == 1:
				att.atk += 0.04
var p3 = 30
class b_btl_fyhl:
	extends "../../../azurlane_ctrl/AzurBuff.gd"
	func _init():
		attInit()
		id = "b_btl_fyhl"	
		att.suck = 0.04
		att.cri = 0.04
		att.criR = 0.04
		buffName = "防御号令"
		dispel = 2
	func _connect():
		if masCha.upgraded == 1:
			att.atk += 0.04

func _onBattleEnd():
	._onBattleEnd()
	gdCount = 0

func fyzj():
	for i in getCellChas(aiCha.cell, 1, 1):
		createCustEff(sys.main.map.map_to_world(i.position), "eff/zhan", 6, false, 0.3, Vector2(0, -40))
		.normalAtkChara(i)